<script setup></script>

<template>
  <!-- 主要内容 -->
  <div class="container main-content">
    <div class="content-grid">
      <!-- 左侧内容区 -->
      <div>
        <!-- 面包屑导航 -->
        <div class="breadcrumb">
          <ol class="breadcrumb-list">
            <li class="breadcrumb-item">
              <a href="wiki.html" class="breadcrumb-link">资料库</a>
            </li>
            <li class="breadcrumb-item">
              <span class="breadcrumb-separator">/</span>
              <span class="breadcrumb-link">作物</span>
            </li>
          </ol>
        </div>

        <!-- 资料详情 -->
        <div class="wiki-content">
          <h1 class="text-3xl font-bold text-gray-900">草莓</h1>
          <p>
            草莓是春季最赚钱的作物之一，在春季13日的复活节节日上可以购买种子。每颗种子售价100金币，成熟后可以收获多次。
          </p>

          <h2 class="text-2xl font-bold text-gray-900 mb-4">种植建议</h2>
          <ul class="list-disc list-inside text-gray-700 mb-4">
            <li>建议在春季13日购买种子后立即种植</li>
            <li>使用优质肥料可以提高品质</li>
            <li>使用洒水器可以节省浇水时间</li>
            <li>建议在温室中种植，可以全年收获</li>
          </ul>

          <h2 class="text-2xl font-bold text-gray-900 mb-4">收益分析</h2>
          <table>
            <thead>
              <tr>
                <th>品质</th>
                <th>售价</th>
                <th>利润</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td>普通</td>
                <td>120金币</td>
                <td>20金币</td>
              </tr>
              <tr>
                <td>银星</td>
                <td>150金币</td>
                <td>50金币</td>
              </tr>
              <tr>
                <td>金星</td>
                <td>180金币</td>
                <td>80金币</td>
              </tr>
              <tr>
                <td>紫星</td>
                <td>240金币</td>
                <td>140金币</td>
              </tr>
            </tbody>
          </table>

          <h2 class="text-2xl font-bold text-gray-900 mb-4">相关配方</h2>
          <ul class="list-disc list-inside text-gray-700 mb-4">
            <li>果酱：需要1个草莓，售价260金币</li>
            <li>果酒：需要1个草莓，售价360金币</li>
          </ul>
        </div>
      </div>

      <!-- 右侧边栏 -->
      <div class="sidebar">
        <!-- 相关作物 -->
        <div class="sidebar-card">
          <div class="sidebar-content">
            <h3 class="sidebar-title">相关作物</h3>
            <div class="sidebar-list">
              <a href="#" class="hot-crop">
                <img
                  src="https://images.unsplash.com/photo-1612287230202-1ff1d85d1bdf?w=500&auto=format&fit=crop&q=60"
                  alt="蓝莓"
                  class="hot-crop-image"
                />
                <div class="hot-crop-info">
                  <h4>蓝莓</h4>
                  <p>夏季作物</p>
                </div>
              </a>
              <a href="#" class="hot-crop">
                <img
                  src="https://images.unsplash.com/photo-1612287230202-1ff1d85d1bdf?w=500&auto=format&fit=crop&q=60"
                  alt="蔓越莓"
                  class="hot-crop-image"
                />
                <div class="hot-crop-info">
                  <h4>蔓越莓</h4>
                  <p>秋季作物</p>
                </div>
              </a>
            </div>
          </div>
        </div>

        <!-- 最新讨论 -->
        <div class="latest-discussions">
          <h2 class="discussions-title">最新讨论</h2>
          <div class="discussions-list">
            <div class="discussion-item">
              <h3 class="discussion-title">草莓种植技巧分享</h3>
              <p class="discussion-desc">分享一些提高草莓产量的实用技巧...</p>
            </div>
            <div class="discussion-item">
              <h3 class="discussion-title">草莓收益最大化攻略</h3>
              <p class="discussion-desc">如何通过加工提高草莓的收益...</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped>
body {
  font-family: "Noto Sans SC", sans-serif;
  background-color: #f9fafb;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* 导航栏 */
.navbar {
  background-color: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
  padding: 0 1rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
}

.navbar-logo {
  height: 2rem;
  width: auto;
}

.navbar-title {
  margin-left: 0.5rem;
  font-size: 1.25rem;
  font-weight: bold;
  color: #059669;
}

.navbar-nav {
  display: none;
}

.nav-link {
  color: #6b7280;
  text-decoration: none;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}

.nav-link.active,
.nav-link:focus {
  color: #111827;
  border-bottom-color: #059669;
}

.nav-link:hover {
  color: #374151;
  border-bottom-color: #d1d5db;
}

.login-btn {
  background-color: #059669;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
}

.login-btn:hover {
  background-color: #047857;
}

/* 主体布局 */
.main-content {
  padding: 2rem 0;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .content-grid {
    grid-template-columns: 2fr 1fr;
  }

  .sidebar {
    margin-top: 0;
  }
}

/* 面包屑导航 */
.breadcrumb {
  margin-bottom: 1.5rem;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-link {
  color: #6b7280;
  text-decoration: none;
}

.breadcrumb-link:hover {
  color: #374151;
}

.breadcrumb-separator {
  margin: 0 1rem;
  color: #9ca3af;
}

/* 资料详情 */
.wiki-content {
  line-height: 1.8;
}

.wiki-content p {
  margin-bottom: 1.5rem;
}

.wiki-content img {
  border-radius: 0.5rem;
  margin: 1.5rem 0;
}

.wiki-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.wiki-content th,
.wiki-content td {
  border: 1px solid #e5e7eb;
  padding: 0.75rem;
  text-align: left;
}

.wiki-content th {
  background-color: #f9fafb;
  font-weight: 500;
}

/* 侧边栏 */
.sidebar {
  margin-top: 2rem;
}

.sidebar-card {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  margin-bottom: 2rem;
}

.sidebar-content {
  padding: 1.5rem;
}

.sidebar-title {
  font-size: 1.125rem;
  font-weight: 500;
  color: #111827;
  margin-bottom: 1rem;
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-link {
  display: flex;
  justify-content: space-between;
  color: #6b7280;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.sidebar-link:hover {
  color: #111827;
}

.sidebar-count {
  color: #9ca3af;
}

.hot-crop {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.hot-crop-image {
  width: 4rem;
  height: 4rem;
  border-radius: 0.5rem;
  object-fit: cover;
}

.hot-crop-info h4 {
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
  margin: 0;
}

.hot-crop-info p {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}

/* 页脚 */
.footer {
  background-color: white;
  margin-top: 3rem;
  padding: 3rem 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: -0.5rem -1.25rem;
}

.footer-link {
  padding: 0.5rem 1.25rem;
  color: #6b7280;
  text-decoration: none;
  font-size: 1rem;
}

.footer-link:hover {
  color: #111827;
}

.footer-copyright {
  text-align: center;
  color: #9ca3af;
  font-size: 1rem;
  margin-top: 2rem;
}

@media (min-width: 640px) {
  .navbar-nav {
    display: flex;
    gap: 2rem;
  }
}

/* 最新讨论样式 */
.latest-discussions {
  background-color: #ffffff;
  border-radius: 8px;
  padding: 20px;
  margin: 20px auto;
  max-width: 600px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.discussions-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #333333;
}

.discussion-item {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.discussion-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.discussion-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 6px;
  color: #333333;
}

.discussion-desc {
  font-size: 14px;
  color: #999999;
  margin: 0;
  line-height: 1.5;
}
</style>
